Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[자동차 경주] 김민겸 미션 제출합니다. #2397

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Mingyum-Kim
Copy link

💪 프로젝트 개요

자동차 경주 게임을 구현한다.
자동차의 이름과 전진을 시도할 횟수를 입력받고, 자동차를 전진시킨 후 우승자를 선정한다.

📝 구현 기능 목록

자동차 이름을 입력하는 기능

  • 경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)를 출력한다.
  • 자동차의 이름을 입력받는다.
    • 빈 문자열이 아님을 검증한다.
    • 올바른 구분자로 구분되었음을 검증한다.
    • 중복되는 이름이 없음을 검증한다.
    • 5자 이하의 이름인지 검증한다.

시도할 횟수를 입력하는 기능

  • 시도할 회수는 몇회인가요?를 출력한다.
  • 시도할 횟수를 입력한다.
    • 빈 문자열이 아님을 검증한다.
    • 1 이상의 숫자로 이루어져 있음을 검증한다.

자동차를 전진하는 기능

  • 입력한 횟수만큼 자동차 전진을 시도한다.
  • 무작위 값을 생성하고 전진하는 조건을 검사한다.
  • 조건에 부합한다면 자동차를 전진시킨다.

자동차의 상태를 출력하는 기능

  • 모든 자동차의 이름과 이동한 갯수를 뷰에 전달한다.
  • 뷰에서 자동차 이름을 출력하고 이동한 갯수를 -로 출력한다.

우승자를 출력하는 기능

  • 가장 많이 이동한 자동차를 선정한다.
  • 최종 우승자 : pobi와 같이 우승자를 출력한다.

@Mingyum-Kim Mingyum-Kim changed the title [김민겸] 미션 제출합니다. [자동차 경주] 김민겸 미션 제출합니다. Dec 14, 2023
Comment on lines +18 to +19
Cars cars = new Cars(inputView.readCarNames());
int count = inputView.readTryCount();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retry를 사용하고 싶을 때는, 아래와 같이 사용한다.

Suggested change
Cars cars = new Cars(inputView.readCarNames());
int count = inputView.readTryCount();
Cars cars = retry(inputView::readCarNames);
int count = retry(inputView::readTryCount);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant